# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Kyle Keen <keenerd@gmail.com>

pkgname=python-ipywidgets
_pipname=ipywidgets
pkgver=8.0.6
pkgrel=4
pkgdesc='IPython HTML widgets for Jupyter'
arch=(any)
url='https://github.com/ipython/ipywidgets'
license=(BSD)
depends=(python-ipykernel python-jsonschema python-ipython-genutils)
makedepends=(python-build python-installer python-setuptools python-wheel)
optdepends=('jupyterlab-widgets: widgets for Jupyter lab' 'jupyter-widgetsnbextension: widgets for the legacy notebook')
checkdepends=(python-pytest python-pytz)
source=(https://pypi.io/packages/source/${_pipname:0:1}/$_pipname/$_pipname-$pkgver.tar.gz)
sha256sums=('de7d779f2045d60de9f6c25f653fdae2dba57898e6a1284494b3ba20b6893bb8')

build() {
  cd ipywidgets-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd ipywidgets-$pkgver
  pytest -v
}

package() {
  cd ipywidgets-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
}
